<template>
    <div>
        <!-- {{cat_data}} -->
        <div class = "wen1">
            <div class = "wen2">
                <el-avatar><img :src="cat_data.img" style="width:60px;height:60px" alt=""></el-avatar>
            </div>
            <div class = "wen3">
                {{cat_data.name}}<br>
                <font color="gray" size="2">{{cat_data.month}}</font>&emsp;&emsp;<font color="gray" size="2">{{cat_data.kind}}</font>&emsp;&emsp;<font color="gray" size="2">{{cat_data.addr}}</font>
            </div>
        </div><br><br>
        <div class="xin">
            <b>基本信息调查</b>
        </div><br>
        <div class="web">
            1年内是否接种疫苗&emsp;
            <el-radio v-model="radio" :label="1">是</el-radio><el-radio v-model="radio" :label="0">否</el-radio>
            <br><br>
            3个月内是否体内驱虫
                <el-radio v-model="radiol" :label="1">是</el-radio><el-radio v-model="radiol" :label="0">否</el-radio><br><br>
            是否绝育
                <el-radio v-model="radioz" :label="1">是</el-radio><el-radio v-model="radioz" :label="0">否</el-radio>
        </div><br>
        <div class="xin">
            <b>症状描述</b>
        </div><br>
        <div class="wen1">
        <el-input
            type="textarea"
            :rows="2"
            placeholder="请输入内容"
            v-model="textarea">
        </el-input>
        </div><br>
        <div class="wen6">
            <el-button style="width:300px" type="warning" round @click="ti">提交信息</el-button>
        </div>
    </div>
</template>

<script>
export default {
    data(){
        return{
            // 获取医生id：
            yi_id : this.$route.params.id,

            // 获取数据：
            cat_data :{},
            radio:'',
            radiol:'',
            radioz:'',
            textarea:''
        }
    },
    methods:{
        get_cat(){
            this.axios.get('inqu/cat',{headers:{'token':localStorage.getItem('token')}})
            .then(resp=>{
                console.log(resp)
                this.cat_data = resp.data.dat
            }).catch(err=>{
                console.log(err)
            })
        },
        ti(){
            this.axios.post('inqu/wen',{
                'radio':this.radio,
                'radiol':this.radiol,
                'radioz':this.radioz,
                'textarea':this.textarea,
                'yi_id':this.yi_id,
                'cat_id':this.cat_data['id']
            },{headers:{'token':localStorage.getItem('token')}}).then(resp=>{
                console.log(resp)
                if(resp.data.code == 200){
                    alert(resp.data.msg)
                }else{
                    alert(resp.data.msg)
                }
            }).catch(err=>{
                console.log(err)
            })
        }
    },
    mounted(){
        this.get_cat();
        console.log(this.yi_id)
    }
}
</script>

<style>
    .wen1{
        width: 300px;
        height: 100px;
        background-color: aqua;
        border-radius: 10px;
        display: flex;
        text-align: left;
    }
    .web{
        width: 300px;
        height: 100px;
        background-color: aqua;
        border-radius: 10px;
        text-align: left;
    }
    .wen2{
        width: 90px;
        height: 80px;
        /* background-color: beige; */
        margin-top: 25px;
    }
    .wen3{
        width: 250px;
        height: 100px;
        margin-top: 20px;
        text-align: left;
        /* background-color: blue; */
    }
    .xin{
        text-align: left;
    }
    .wen6{
        text-align: left;
    }
</style>